package net.lab1024.sa.ai.stream;

import net.lab1024.sa.base.listener.Ip2RegionListener;
import net.lab1024.sa.base.listener.LogVariableListener;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@EnableCaching
@EnableScheduling
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@SpringBootApplication(exclude = {UserDetailsServiceAutoConfiguration.class})
@ComponentScan(
    basePackages = "net.lab1024.sa",
    excludeFilters = @ComponentScan.Filter(
        type = FilterType.ASSIGNABLE_TYPE,
        classes = {
            net.lab1024.sa.base.config.UrlConfig.class,
            net.lab1024.sa.base.module.support.job.config.SmartJobAutoConfiguration.class
        }
    )
)
@MapperScan(value = AiStreamApplication.COMPONENT_SCAN, annotationClass = Mapper.class)
public class AiStreamApplication {
    public static final String COMPONENT_SCAN = "net.lab1024.sa";
    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(AiStreamApplication.class);
        application.addListeners(new LogVariableListener(), new Ip2RegionListener());
        application.run(args);
    }
} 